home *** CD-ROM | disk | FTP | other *** search
- Path: locutus.rchland.ibm.com!usenet
- From: pstaite@vnet.ibm.com
- Newsgroups: comp.lang.c++
- Subject: Re: Argument from commandline???
- Date: 2 Feb 1996 15:31:37 GMT
- Organization: IBM OS/2 Device Driver Development Rochester, MN
- Message-ID: <4etaop$ilm@locutus.rchland.ibm.com>
- References: <4eou36$p6g@prometheus.algonet.se>
- Reply-To: pstaite@vnet.ibm.com
- NNTP-Posting-Host: warpone.rchland.ibm.com
- X-Newsreader: IBM NewsReader/2 v1.2
-
- In <4eou36$p6g@prometheus.algonet.se>, bifrost@algonet.se (Nylund Patrik) writes:
- >How do I include argument from the commandline to the main function in
- >a c++ program?
-
- Same as in C:
-
-
- #include<iostream.h>
-
- int main( int argc, char* argv[] ) {
- for( int i = 0 ; i < argc ; ++i )
- cout << "Argument " << i << " is " << argv[ i ] << endl;
- return 0; }
-
-
- Phil Staite, team OS/2
- internet: pstaite@vnet.ibm.com internal: pstaite@rchland
-
-